package github.kawaiior.yuanchuxiuzhen.core.init;

import github.kawaiior.yuanchuxiuzhen.Yuanchuxiuzhen;
import github.kawaiior.yuanchuxiuzhen.common.container.*;
import github.kawaiior.yuanchuxiuzhen.common.container.number.PelletFurnaceContainerItemNumber;
import github.kawaiior.yuanchuxiuzhen.common.container.number.WeaponFurnaceContainerItemNumber;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.network.PacketBuffer;
import net.minecraftforge.common.extensions.IForgeContainerType;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;

public class ContainerInit {
    public static final DeferredRegister<ContainerType<?>> CONTAINER_TYPE = DeferredRegister.create(ForgeRegistries.CONTAINERS, Yuanchuxiuzhen.MODID);

    public static final RegistryObject<ContainerType<MaterialConverterContainer>> MATERIAL_CONVERTER_GUI_CONTAINER =
            CONTAINER_TYPE.register("material_converter_gui_container",
                    ()->IForgeContainerType.create(MaterialConverterContainer::new));

    public static final RegistryObject<ContainerType<GongFaCreateContainer>> GONG_FA_CREATE_CONTAINER =
            CONTAINER_TYPE.register("gong_fa_create_container",
                    ()->IForgeContainerType.create(GongFaCreateContainer::new));

    public static final RegistryObject<ContainerType<ManaStoneConverterContainer>> MANA_STONE_CONVERTER_CONTAINER =
            CONTAINER_TYPE.register("mana_stone_converter_container",
                    ()->IForgeContainerType.create(ManaStoneConverterContainer::new));

    public static final RegistryObject<ContainerType<PelletFurnaceContainer>> PELLET_FURNACE_CONTAINER =
            CONTAINER_TYPE.register("pellet_furnace_container",
                    ()->IForgeContainerType.create((int windowId, PlayerInventory inv, PacketBuffer data)->
                            new PelletFurnaceContainer(windowId, inv, data, new PelletFurnaceContainerItemNumber())));

    public static final RegistryObject<ContainerType<WeaponFurnaceContainer>> WEAPON_FURNACE_CONTAINER =
            CONTAINER_TYPE.register("weapon_furnace_container",
                    ()->IForgeContainerType.create((int windowId, PlayerInventory inv, PacketBuffer data)->
                            new WeaponFurnaceContainer(windowId, inv, data, new WeaponFurnaceContainerItemNumber())));

//    public static final RegistryObject<ContainerType<ExampleGuiContainer>> EXAMPLE_GUI_CONTIANER =
//            CONTAINER_TYPE.register("example_gui_container", ()->IForgeContainerType.create(ExampleGuiContainer::new));

}
